﻿using UnityEngine;
using System.Collections;

public class HealthHeal : MonoBehaviour {
	private int changeHealth = 50;
	//Change amount of health taken away after test
	
	void OnTriggerEnter2D(Collider2D other){
		if (other.tag == "Player") {
			StartUpScripts.PlayerHealth += changeHealth;
			if(StartUpScripts.PlayerHealth > 100){
				StartUpScripts.PlayerHealth = 100;
				Debug.Log (StartUpScripts.PlayerHealth + "Health went above 100");
			} else {
				Debug.Log (StartUpScripts.PlayerHealth + "Health was not above 100");
			}

			Destroy (gameObject);
		}
	}
}
